package global;
import java.io.*;
/** class TID
 */

public class TID
{

public	int numRIDs;
public	int position;
public  RID[] recordIDs;

public TID()
{
	
}
  public TID(int numRIDs)
  {
	  this.numRIDs = numRIDs;
  }
   
  public TID(int numRIDs, int position)
  {
	  this.numRIDs = numRIDs;
	  this.position = position;
  }
   public TID(int numRIDs, int position, RID[] recordIDs)
  {
	      this.numRIDs = numRIDs;
		  this.position = position;
		  this.recordIDs = recordIDs;
	   
  }
  
    
  /**
   * make a copy of the given tid
   */
  public void copyTid (TID tid)
    {
	    this.numRIDs = tid.numRIDs;
		 this. position = tid.position;
		  this.recordIDs = tid.recordIDs;
	  
    }
      
  /** Compares two TID object, i.e, this to the tid
 
   */
  public boolean equals(TID tid) {
    
    if ((this.numRIDs==tid.numRIDs)
	&&(this.position==tid.position)
	&&(this.recordIDs== tid.recordIDs) )
      return true;
    else
      return false;
  }
  
  /** Write the rid into a byte array at offset
   * @param ary the specified byte array
   * @param offset the offset of byte array to write 
   * @exception java.io.IOException I/O errors
   */ 
  // columnar implementation - empty method ..never used
  public void writeToByteArray(byte [] ary, int offset)
    throws java.io.IOException
    {
      //Convert.setIntValue ( slotNo, offset, ary);
      //Convert.setIntValue ( pageNo.pid, offset+4, ary);
    }
}